package file;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

public class ReadFile2 {

	public static void main(String[] args) throws IOException, InterruptedException {
		FileInputStream stream = new FileInputStream(new File("D:/autolog_20141017"));
		FileChannel channel = stream.getChannel();
		ByteBuffer bytes = ByteBuffer.allocate(1024 * 10);

		while (channel.read(bytes) != -1) {
			String tmp = new String(bytes.array());

			ByteTest.splitBy4(tmp, "pic.auto.sohu.com");

			Thread.sleep(3 * 1000);
		}
		stream.close();
		channel.close();
	}
}
